<!DOCTYPE html>
<html lang="zh" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>中原工学院企业微信管理后台</title>
    <link rel="icon" type="image/x-icon" th:href="@{/favicon.ico}" />
    <link rel="stylesheet" th:href="@{/css/footer.css}"/>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet"/>

</head>
<body>
<!--<header th:replace="pc/menu/manager_menu :: header"></header>-->

<div class="center-block panel panel-info " style="min-height:570px;width:80%">
    <div class="panel-heading">
        <h3 class="panel-title">
            部门信息
        </h3>
    </div>

    <div class="panel-body">
        <div class="row clearfix">
            <div class="col-md-4 col-sm-4 col-xs-4">
                <div class="input-group">
                    <span class="input-group-addon">名称</span>
                    <input id="name" class="form-control" type="text" />
                    <a id="a_clear" class="glyphicon glyphicon-remove btn form-control-feedback" style="pointer-events: auto"></a>
                </div>
            </div>
            <div class="col-md-4 col-sm-4 col-xs-4">
                <button type="button" class="btn btn-primary" onclick="load_data(0)">查询</button>&nbsp;&nbsp;
                <button type="button" class="btn btn-info" onclick="update_data(0)">同步数据</button>&nbsp;&nbsp;
            </div>
        </div>
        <hr/>
        <table class="table table-hover">
            <thead>
            <tr>
                <th>Id</th>
                <th>名称</th>
                <th>类别</th>
                <th>隶属</th>
                <th>排序</th>
                <th>微信ID</th>
            </tr>
            </thead>
            <tbody id="my_tbody">
            </tbody>
        </table>
        <hr/>
        <div class="row clearfix">
            <div class="col-md-3 col-sm-3 col-xs-3">
                共<label id="total_count" style="color:#080808" >0</label>条记录,当前<label id="current_page" style="color:#080808">1</label>页。
            </div>
            <div class="col-md-9 col-sm-9 col-xs-9" align="right">
                <ul id="page" style="margin: 0 0">
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script th:src="@{/js/bootstrap-paginator.min.js}" type="text/javascript"></script>
<script th:inline="javascript">
    /*<![CDATA[*/
    $(document).ready(function(){
        $("#li_data").attr("class", "active");
        load_data(0);
        $("#a_clear").click(function () {
            $('#name').val("");
        });
    });

    $('#page').bootstrapPaginator({
        currentPage: 1,//当前的请求页面。
        totalPages: 1,//一共多少页。
        size: "normal",//页眉的大小。
        bootstrapMajorVersion: 3,//bootstrap的版本要求。
        alignment: "right",
        numberOfPages: 10,//一页列出多少数据。
        itemTexts: function (type, page, current) {//如下的代码是将页眉显示的中文显示我们自定义的中文。
            switch (type) {
                case "first":
                    return "首页";
                case "prev":
                    return "上一页";
                case "next":
                    return "下一页";
                case "last":
                    return "末页";
                case "page":
                    return page;
            }
        },
        onPageClicked: function (event, originalEvent, type, page) {
            load_data(page-1);
        }
    });
</script>
</html>